//
//  LotteryLayout.m
//  K8彩票
//
//  Created by zhoubo on 2017/6/7.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "LotteryLayout.h"
@interface LotteryLayout()

@property(nonatomic,assign)NSInteger num;

@end

@implementation LotteryLayout

-(instancetype)initWithNum:(NSInteger)num
{
    if (self = [super init]) {
        
        _num = num;
        
    }
    return self;
}

-(void)prepareLayout
{
    CGFloat width = ([UIScreen mainScreen].bounds.size.width - self.num*10 -10)/self.num;
    
    //设置headview的size
    self.headerReferenceSize = CGSizeMake( [UIScreen mainScreen].bounds.size.width,  [UIScreen mainScreen].bounds.size.width*0.62+30);
    
    self.itemSize = CGSizeMake(width, width/self.num);
    
    self.sectionInset =UIEdgeInsetsMake(10, 10, 0, 10);
    self.minimumLineSpacing=10;
    self.minimumInteritemSpacing = 10;
    self.collectionView.showsVerticalScrollIndicator = false;
    
}




@end
